﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Ors.RInterface.Engine.PInvoke
{
    //    /* Flags */
    //struct sxpinfo_struct {
    //    SEXPTYPE type      :  5;/* ==> (FUNSXP == 99) %% 2^5 == 3 == CLOSXP
    //                 * -> warning: `type' is narrower than values
    //                 *              of its type
    //                 * when SEXPTYPE was an enum */
    //    unsigned int obj   :  1;
    //    unsigned int named :  2;
    //    unsigned int gp    : 16;
    //    unsigned int mark  :  1;
    //    unsigned int debug :  1;
    //    unsigned int trace :  1;  /* functions and memory tracing */
    //    unsigned int spare :  1;  /* currently unused */
    //    unsigned int gcgen :  1;  /* old generation number */
    //    unsigned int gccls :  3;  /* node class */
    //}; /*		    Tot: 32 */
    [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi)]
    public struct  SXPINFO
    {
        [FieldOffset(0)]
        public SEXPTYPE type;
        [FieldOffset(0)]
        public UInt32 obj;
        [FieldOffset(0)]
        public UInt32 named;
        [FieldOffset(0)]
        public UInt32 gp;
        [FieldOffset(0)]
        public UInt32 mark;
        [FieldOffset(0)]
        public UInt32 debug;
        [FieldOffset(0)]
        public UInt32 trace;
        [FieldOffset(0)]
        public UInt32 spare;
        [FieldOffset(0)]
        public UInt32 gcgen;
        [FieldOffset(0)]
        public UInt32 gccls;
    }
}
